package com.ego.product.vo.member;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @program: ego
 * @description: 用户注册VO
 * @author: KamTang
 * @create: 2022-12-13 12:08
 **/
@Setter
@Getter
public class UserRegisterVo {

    @NotEmpty(message = "用户名不能为空")
    @Length(min = 2, max = 12, message = "限2~12个中文、英文或数字")
    private String username;

    @NotEmpty(message = "密码不能为空")
    @Length(min = 6, max = 18, message = "密码长度必须满足6~18位")
    private String password;

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "手机号格式错误")
    private String phone;

    @NotEmpty(message = "验证码不能为空")
    private String code;
}
